import 'package:flutter_city4_package/city4_entity.dart';

city4EntityFromJson(City4Entity data, Map<String, dynamic> json) {
	if (json['code'] != null) {
		data.code = json['code'].toString();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['children'] != null) {
		data.children = (json['children'] as List).map((v) => City4Children().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> city4EntityToJson(City4Entity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['code'] = entity.code;
	data['name'] = entity.name;
	data['children'] =  entity.children?.map((v) => v.toJson())?.toList();
	return data;
}

city4ChildrenFromJson(City4Children data, Map<String, dynamic> json) {
	if (json['code'] != null) {
		data.code = json['code'].toString();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['children'] != null) {
		data.children = (json['children'] as List).map((v) => City4ChildrenChildren().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> city4ChildrenToJson(City4Children entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['code'] = entity.code;
	data['name'] = entity.name;
	data['children'] =  entity.children?.map((v) => v.toJson())?.toList();
	return data;
}

city4ChildrenChildrenFromJson(City4ChildrenChildren data, Map<String, dynamic> json) {
	if (json['code'] != null) {
		data.code = json['code'].toString();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['children'] != null) {
		data.children = (json['children'] as List).map((v) => City4ChildrenChildrenChildren().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> city4ChildrenChildrenToJson(City4ChildrenChildren entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['code'] = entity.code;
	data['name'] = entity.name;
	data['children'] =  entity.children?.map((v) => v.toJson())?.toList();
	return data;
}

city4ChildrenChildrenChildrenFromJson(City4ChildrenChildrenChildren data, Map<String, dynamic> json) {
	if (json['code'] != null) {
		data.code = json['code'].toString();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['children'] != null) {
		data.children = (json['children'] as List).map((v) => City4ChildrenChildrenChildrenChildren().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> city4ChildrenChildrenChildrenToJson(City4ChildrenChildrenChildren entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['code'] = entity.code;
	data['name'] = entity.name;
	data['children'] =  entity.children?.map((v) => v.toJson())?.toList();
	return data;
}

city4ChildrenChildrenChildrenChildrenFromJson(City4ChildrenChildrenChildrenChildren data, Map<String, dynamic> json) {
	if (json['code'] != null) {
		data.code = json['code'].toString();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	return data;
}

Map<String, dynamic> city4ChildrenChildrenChildrenChildrenToJson(City4ChildrenChildrenChildrenChildren entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['code'] = entity.code;
	data['name'] = entity.name;
	return data;
}